package com.wantupai.app.httpnet;

import com.google.gson.annotations.SerializedName;

/**
 * 服务器通用返回数据格式
 * Created by wmq on 2019-05-13.
 */
public class BaseEntity<E> {


    @SerializedName("code")
    private int code;

    @SerializedName("data")
    private E data;

    public String getMsg() {
        return msg;
    }

    @SerializedName("msg")
    private String msg;

    public boolean isSuccess() {
        return code == 1;
    }

    public int getCode() {
        return code;
    }



    public E getData() {
        return data;
    }

    @Override
    public String toString() {
        return "BaseEntity{" +
                "code=" + code +
                ", data=" + data +
                ", msg='" + msg + '\'' +
                '}';
    }
}
